import 'package:flutter/material.dart';
import 'package:fly/app/modules/home/views/dot_render_controller.dart';
import 'package:fly/app/modules/home/views/dot_screen_view.dart';

import 'package:get/get.dart';

import '../../../../r.g.dart';
import '../controllers/home_controller.dart';

class HomeView extends GetView<HomeController> {
  const HomeView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('HomeView'),
        centerTitle: true,
      ),
      body: Center(
        child: Column(
          children: [
            SizedBox(
              height: 100,
            ),
            DotScreenView(
              controller: controller.dotRenderController,
              //controller: DotRenderController(initDots: DotRenderController.testDotsHello),
            ),
            SizedBox(
              height: 30,
            ),
            GestureDetector(
                onTap: () {
                  controller.dotRenderController.scrollShowTxt();
                },
                child: Text("press me to refresh!")),
            SizedBox(
              height: 30,
            ),
            GestureDetector(
                onTap: () {
                  controller.dotRenderController.appendScrollTxt();
                },
                child: Text("press me to append !")),
            SizedBox(
              height: 30,
            ),
            GestureDetector(
                onTap: () {
                  controller.dotRenderController.reset();
                },
                child: Text("press me to reset!"))
          ],
        ),
      ),
    );
  }
}
